package c.h.a.w.l;

import c.h.a.m0.j;
import c.h.a.w.g;
import c.h.a.w.k.h;
import c.h.a.w.k.i;
import com.liuzh.deviceinfo.DeviceInfoApp;
import com.liuzh.deviceinfo.analyzer.StorageAnalyzeActivity;
import java.util.Objects;

/* compiled from: AbsAnalyzerTask */
public class a implements Runnable {
    public final /* synthetic */ String a;
    public final /* synthetic */ b b;

    /* compiled from: AbsAnalyzerTask */
    public class a implements Runnable {
        public void run() {
            Objects.requireNonNull((StorageAnalyzeActivity) a.this.b.e);
        }
    }

    /* compiled from: AbsAnalyzerTask */
    public class e implements Runnable {
        public final /* synthetic */ h a;

        public e(h hVar) {
            this.a = hVar;
        }

        public void run() {
            c.h.a.w.l.b.a aVar = a.this.b.e;
            h hVar = this.a;
            StorageAnalyzeActivity storageAnalyzeActivity = (StorageAnalyzeActivity) aVar;
            storageAnalyzeActivity.t = hVar;
            c.h.a.w.e eVar = hVar.a;
            if (!(eVar == null || eVar.i.contains(storageAnalyzeActivity))) {
                eVar.i.add(storageAnalyzeActivity);
            }
            storageAnalyzeActivity.x.addAll(hVar.c);
            storageAnalyzeActivity.x.add(0, new i(5));
            storageAnalyzeActivity.x.add(1, new i(4));
            com.liuzh.deviceinfo.analyzer.StorageAnalyzeActivity.b bVar = storageAnalyzeActivity.u;
            bVar.a.e(0, storageAnalyzeActivity.x.size());
            storageAnalyzeActivity.s.setVisibility(0);
            storageAnalyzeActivity.w.setVisibility(8);
            storageAnalyzeActivity.w.c();
            storageAnalyzeActivity.z.setVisibility(8);
            if (storageAnalyzeActivity.t.e.a(new g(storageAnalyzeActivity)) != null) {
                storageAnalyzeActivity.B();
            }
            c.h.a.v.a.b.c("analyze_comp", null);
        }
    }

    /* compiled from: AbsAnalyzerTask */
    public class b implements c.h.a.w.k.i.a {
        public final /* synthetic */ h a;

        public b(a aVar, h hVar) {
            this.a = hVar;
        }

        public String a() {
            StringBuilder stringBuilder = new StringBuilder();
            stringBuilder.append(j.f(this.a.b.e));
            stringBuilder.append(" / ");
            stringBuilder.append(DeviceInfoApp.c.getString(2131689915, new Object[]{Integer.valueOf(this.a.b.a())}));
            return stringBuilder.toString();
        }
    }

    /* compiled from: AbsAnalyzerTask */
    public class c implements c.h.a.w.k.i.a {
        public final /* synthetic */ h a;

        public c(a aVar, h hVar) {
            this.a = hVar;
        }

        public String a() {
            return j.f(this.a.d.c);
        }
    }

    /* compiled from: AbsAnalyzerTask */
    public class d implements c.h.a.w.k.i.a {
        public final /* synthetic */ h a;

        public d(a aVar, h hVar) {
            this.a = hVar;
        }

        public String a() {
            if (this.a.e.a(null) == null) {
                return DeviceInfoApp.c.getString(2131689555);
            }
            StringBuilder stringBuilder = new StringBuilder();
            stringBuilder.append(j.f(this.a.e.g));
            stringBuilder.append(" / ");
            stringBuilder.append(DeviceInfoApp.c.getString(2131690027, new Object[]{Integer.valueOf(this.a.e.h)}));
            return stringBuilder.toString();
        }
    }

    public a(b bVar, String str) {
        this.b = bVar;
        this.a = str;
    }

    /* JADX WARNING: Missing block: B:83:0x0319, code skipped:
            r3.clear();
            java.util.Collections.sort(r0.c, new c.h.a.w.k.g(r0));
            r0.e = true;
     */
    /* JADX WARNING: Missing block: B:84:0x032a, code skipped:
            if (r0.f == false) goto L_0x032d;
     */
    /* JADX WARNING: Missing block: B:85:0x032d, code skipped:
            monitor-enter(r2);
     */
    /* JADX WARNING: Missing block: B:87:?, code skipped:
            r3 = r0.d.iterator();
     */
    /* JADX WARNING: Missing block: B:89:0x0338, code skipped:
            if (r3.hasNext() == false) goto L_0x0348;
     */
    /* JADX WARNING: Missing block: B:90:0x033a, code skipped:
            ((c.h.a.w.k.e.f) r3.next()).a(r0.b, r0.c);
     */
    /* JADX WARNING: Missing block: B:91:0x0348, code skipped:
            monitor-exit(r2);
     */
    /* JADX WARNING: Missing block: B:92:0x0349, code skipped:
            r0.d.clear();
            r3 = new java.lang.StringBuilder();
            r3.append("checkRepeatFile: count = ");
            r3.append(r0.b.size());
            r3.append(", time = ");
            r3.append(java.lang.System.currentTimeMillis() - r5);
            android.util.Log.d("AnalyzeRepeatFile", r3.toString());
     */
    /* JADX WARNING: Missing block: B:143:?, code skipped:
            return;
     */
    /* JADX WARNING: Missing block: B:144:?, code skipped:
            return;
     */
    public void run() {
        /*
        r18 = this;
        r1 = r18;
        r0 = r1.b;
        r2 = r0.e;
        if (r2 == 0) goto L_0x0012;
    L_0x0008:
        r0 = r0.f;
        r2 = new c.h.a.w.l.a$a;
        r2.m2128init();
        r0.post(r2);
    L_0x0012:
        r0 = r1.b;
        r2 = r1.a;
        r0 = (c.h.a.w.l.c) r0;
        java.util.Objects.requireNonNull(r0);
        r3 = c.h.a.w.l.c.class;
        r4 = new java.lang.StringBuilder;
        r4.<init>();
        r5 = "MultiThreadAnalyzerTask2#analyze:  start ";
        r4.append(r5);
        r5 = r3.getName();
        r4.append(r5);
        r4 = r4.toString();
        r5 = "MultiThreadAnalyzerTask2";
        android.util.Log.d(r5, r4);
        r6 = java.lang.System.currentTimeMillis();
        r4 = new java.io.File;
        r4.<init>(r2);
        r8 = new c.h.a.w.e;
        r9 = r4.isDirectory();
        r4 = r4.getName();
        r10 = 0;
        r8.m2110init(r9, r4, r10);
        r4 = new c.h.a.w.l.c$a;
        r9 = new java.io.File;
        r9.<init>(r2);
        r4.m2132init(r8, r9);
        r0.a(r4);
    L_0x005b:
        r2 = r0.h;
        r2 = r2.getActiveCount();
        if (r2 != 0) goto L_0x00c0;
    L_0x0063:
        r2 = r0.h;
        r11 = r2.getCompletedTaskCount();
        r2 = r0.h;
        r13 = r2.getTaskCount();
        r2 = (r11 > r13 ? 1 : (r11 == r13 ? 0 : -1));
        if (r2 == 0) goto L_0x0074;
    L_0x0073:
        goto L_0x00c0;
    L_0x0074:
        r2 = r0.h;
        r2.shutdown();
        r8.c();
        r2 = new java.lang.StringBuilder;
        r2.<init>();
        r4 = "MultiThreadAnalyzerTask2#analyze: size = ";
        r2.append(r4);
        r11 = r8.a;
        r4 = c.h.a.m0.j.f(r11);
        r2.append(r4);
        r2 = r2.toString();
        android.util.Log.d(r5, r2);
        r0.b(r8);
        r11 = java.lang.System.currentTimeMillis();
        r0 = "MultiThreadAnalyzerTask2#analyze: finish ";
        r0 = c.b.a.a.a.g(r0);
        r2 = r3.getName();
        r0.append(r2);
        r2 = " - ";
        r0.append(r2);
        r11 = r11 - r6;
        r0.append(r11);
        r2 = " ms";
        r0.append(r2);
        r0 = r0.toString();
        android.util.Log.d(r5, r0);
        goto L_0x00c5;
    L_0x00c0:
        r2 = r0.g;
        if (r2 == 0) goto L_0x005b;
    L_0x00c4:
        r8 = r10;
    L_0x00c5:
        r0 = r1.b;
        r2 = r0.g;
        if (r2 != 0) goto L_0x0386;
    L_0x00cb:
        r2 = r0.e;
        if (r2 == 0) goto L_0x0386;
    L_0x00cf:
        r2 = new c.h.a.w.k.h;
        r2.m2124init();
        r2.a = r8;
        r3 = r0.a;
        r2.b = r3;
        r3 = r0.b;
        r2.d = r3;
        r3 = r0.c;
        r2.e = r3;
        r0 = r0.d;
        r3 = r2.f;
        if (r3 != 0) goto L_0x00ef;
    L_0x00e8:
        r3 = new b.n.l;
        r3.m5107init();
        r2.f = r3;
    L_0x00ef:
        r3 = r2.f;
        r4 = r3.a;
        monitor-enter(r4);
        r5 = r3.e;	 Catch:{ all -> 0x0383 }
        r6 = androidx.lifecycle.LiveData.j;	 Catch:{ all -> 0x0383 }
        r7 = 1;
        if (r5 != r6) goto L_0x00fd;
    L_0x00fb:
        r5 = 1;
        goto L_0x00fe;
    L_0x00fd:
        r5 = 0;
    L_0x00fe:
        r3.e = r0;	 Catch:{ all -> 0x0383 }
        monitor-exit(r4);	 Catch:{ all -> 0x0383 }
        if (r5 != 0) goto L_0x0104;
    L_0x0103:
        goto L_0x010f;
    L_0x0104:
        r0 = b.c.a.a.a.c();
        r3 = r3.i;
        r0 = r0.a;
        r0.b(r3);
    L_0x010f:
        r0 = r1.b;
        r0 = r0.a;
        r0.b();
        r0 = r1.b;
        r0 = r0.b;
        java.util.Objects.requireNonNull(r0);
        r3 = new java.util.ArrayList;
        r4 = r0.a;
        r4 = r4.size();
        r3.<init>(r4);
        r0.b = r3;
        r3 = r0.a;
        r4 = new c.h.a.w.k.a;
        r4.m2114init(r0);
        java.util.Collections.sort(r3, r4);
        r3 = r0.a;
        r3 = r3.iterator();
    L_0x013a:
        r4 = r3.hasNext();
        if (r4 == 0) goto L_0x0164;
    L_0x0140:
        r4 = r3.next();
        r4 = (c.h.a.w.e) r4;
        r5 = r4.i;
        r5 = r5.contains(r0);
        if (r5 != 0) goto L_0x0153;
    L_0x014e:
        r5 = r4.i;
        r5.add(r0);
    L_0x0153:
        r5 = r0.b;
        r6 = r4.b();
        r5.add(r6);
        r5 = r0.c;
        r8 = r4.a;
        r5 = r5 + r8;
        r0.c = r5;
        goto L_0x013a;
    L_0x0164:
        r0 = r1.b;
        r0 = r0.d;
        r0.c();
        r0 = new java.util.ArrayList;
        r0.<init>();
        r3 = new c.h.a.w.k.i;
        r4 = com.liuzh.deviceinfo.DeviceInfoApp.c;
        r5 = 2131690220; // 0x7f0f02ec float:1.9009477E38 double:1.0531949053E-314;
        r4 = r4.getString(r5);
        r5 = new c.h.a.w.l.a$b;
        r5.m6255init(r1, r2);
        r6 = com.liuzh.deviceinfo.DeviceInfoApp.c;
        r8 = 2131690423; // 0x7f0f03b7 float:1.900989E38 double:1.0531950056E-314;
        r6 = r6.getString(r8);
        r3.m2127init(r4, r5, r6, r7);
        r0.add(r3);
        r3 = new c.h.a.w.k.i;
        r4 = com.liuzh.deviceinfo.DeviceInfoApp.c;
        r5 = 2131690036; // 0x7f0f0234 float:1.9009104E38 double:1.0531948144E-314;
        r4 = r4.getString(r5);
        r5 = new c.h.a.w.l.a$c;
        r5.m6256init(r1, r2);
        r6 = com.liuzh.deviceinfo.DeviceInfoApp.c;
        r8 = 2131690422; // 0x7f0f03b6 float:1.9009887E38 double:1.053195005E-314;
        r6 = r6.getString(r8);
        r8 = 3;
        r3.m2127init(r4, r5, r6, r8);
        r0.add(r3);
        r3 = new c.h.a.w.k.i;
        r4 = com.liuzh.deviceinfo.DeviceInfoApp.c;
        r5 = 2131690223; // 0x7f0f02ef float:1.9009484E38 double:1.053194907E-314;
        r4 = r4.getString(r5);
        r5 = new c.h.a.w.l.a$d;
        r5.m6257init(r1, r2);
        r6 = com.liuzh.deviceinfo.DeviceInfoApp.c;
        r8 = 2131690225; // 0x7f0f02f1 float:1.9009488E38 double:1.0531949077E-314;
        r6 = r6.getString(r8);
        r8 = 2;
        r3.m2127init(r4, r5, r6, r8);
        r0.add(r3);
        r2.c = r0;
        r0 = r1.b;
        r0 = r0.f;
        r3 = new c.h.a.w.l.a$e;
        r3.m2129init(r2);
        r0.post(r3);
        r0 = r1.b;
        r0 = r0.c;
        java.util.Objects.requireNonNull(r0);
        r2 = c.h.a.w.k.e.class;
        r5 = java.lang.System.currentTimeMillis();
        r3 = java.lang.Runtime.getRuntime();
        r12 = r3.availableProcessors();
        r3 = new java.util.concurrent.ThreadPoolExecutor;
        r13 = r12 * 2;
        r16 = java.util.concurrent.TimeUnit.MILLISECONDS;
        r17 = new java.util.concurrent.LinkedBlockingDeque;
        r17.<init>();
        r14 = 0;
        r11 = r3;
        r11.<init>(r12, r13, r14, r16, r17);
        r4 = r0.a;
        r4 = r4.values();
        r4 = r4.iterator();
    L_0x020d:
        r8 = r4.hasNext();
        if (r8 == 0) goto L_0x022e;
    L_0x0213:
        r8 = r4.next();
        r8 = (java.util.List) r8;
        r9 = r0.f;
        if (r9 == 0) goto L_0x021f;
    L_0x021d:
        goto L_0x0386;
    L_0x021f:
        r9 = r8.size();
        if (r9 <= r7) goto L_0x020d;
    L_0x0225:
        r9 = new c.h.a.w.k.f;
        r9.m2122init(r0, r8);
        r3.execute(r9);
        goto L_0x020d;
    L_0x022e:
        r4 = r0.a;
        r4.clear();
    L_0x0233:
        r4 = r3.getActiveCount();
        if (r4 != 0) goto L_0x037e;
    L_0x0239:
        r8 = r3.getCompletedTaskCount();
        r11 = r3.getTaskCount();
        r4 = (r8 > r11 ? 1 : (r8 == r11 ? 0 : -1));
        if (r4 == 0) goto L_0x0247;
    L_0x0245:
        goto L_0x037e;
    L_0x0247:
        r3.shutdown();
        r3 = new java.util.ArrayList;
        r3.<init>();
        monitor-enter(r2);
        r4 = r0.b;	 Catch:{ all -> 0x037b }
        r4 = r4.entrySet();	 Catch:{ all -> 0x037b }
        r4 = r4.iterator();	 Catch:{ all -> 0x037b }
    L_0x025a:
        r8 = r4.hasNext();	 Catch:{ all -> 0x037b }
        if (r8 == 0) goto L_0x02fb;
    L_0x0260:
        r8 = r4.next();	 Catch:{ all -> 0x037b }
        r8 = (java.util.Map.Entry) r8;	 Catch:{ all -> 0x037b }
        r9 = r0.f;	 Catch:{ all -> 0x037b }
        if (r9 == 0) goto L_0x026d;
    L_0x026a:
        monitor-exit(r2);	 Catch:{ all -> 0x037b }
        goto L_0x0386;
    L_0x026d:
        r9 = r8.getValue();	 Catch:{ all -> 0x037b }
        r9 = (java.util.List) r9;	 Catch:{ all -> 0x037b }
        r9 = r9.size();	 Catch:{ all -> 0x037b }
        if (r9 <= r7) goto L_0x02f2;
    L_0x0279:
        r13 = new java.util.ArrayList;	 Catch:{ all -> 0x037b }
        r9 = r8.getValue();	 Catch:{ all -> 0x037b }
        r9 = (java.util.Collection) r9;	 Catch:{ all -> 0x037b }
        r13.<init>(r9);	 Catch:{ all -> 0x037b }
        r14 = new java.util.ArrayList;	 Catch:{ all -> 0x037b }
        r9 = r13.size();	 Catch:{ all -> 0x037b }
        r14.<init>(r9);	 Catch:{ all -> 0x037b }
        r9 = 0;
    L_0x028e:
        r11 = r13.size();	 Catch:{ all -> 0x037b }
        if (r9 >= r11) goto L_0x029c;
    L_0x0294:
        r11 = java.lang.Boolean.FALSE;	 Catch:{ all -> 0x037b }
        r14.add(r11);	 Catch:{ all -> 0x037b }
        r9 = r9 + 1;
        goto L_0x028e;
    L_0x029c:
        r15 = new c.h.a.w.k.e$c;	 Catch:{ all -> 0x037b }
        r15.m2119init(r10);	 Catch:{ all -> 0x037b }
        r9 = new c.h.a.w.k.e$b;	 Catch:{ all -> 0x037b }
        r12 = -1;
        r11 = r8.getKey();	 Catch:{ all -> 0x037b }
        r16 = r11;
        r16 = (java.lang.String) r16;	 Catch:{ all -> 0x037b }
        r11 = r9;
        r11.m2118init(r12, r13, r14, r15, r16);	 Catch:{ all -> 0x037b }
        r9.f();	 Catch:{ all -> 0x037b }
        r11 = r0.c;	 Catch:{ all -> 0x037b }
        r11.add(r9);	 Catch:{ all -> 0x037b }
        r9 = r0.h;	 Catch:{ all -> 0x037b }
        r11 = r8.getValue();	 Catch:{ all -> 0x037b }
        r11 = (java.util.List) r11;	 Catch:{ all -> 0x037b }
        r11 = r11.size();	 Catch:{ all -> 0x037b }
        r9 = r9 + r11;
        r0.h = r9;	 Catch:{ all -> 0x037b }
        r8 = r8.getValue();	 Catch:{ all -> 0x037b }
        r8 = (java.util.List) r8;	 Catch:{ all -> 0x037b }
        r8 = r8.iterator();	 Catch:{ all -> 0x037b }
    L_0x02d1:
        r9 = r8.hasNext();	 Catch:{ all -> 0x037b }
        if (r9 == 0) goto L_0x025a;
    L_0x02d7:
        r9 = r8.next();	 Catch:{ all -> 0x037b }
        r9 = (c.h.a.w.e) r9;	 Catch:{ all -> 0x037b }
        r11 = r9.i;	 Catch:{ all -> 0x037b }
        r11 = r11.contains(r0);	 Catch:{ all -> 0x037b }
        if (r11 != 0) goto L_0x02ea;
    L_0x02e5:
        r11 = r9.i;	 Catch:{ all -> 0x037b }
        r11.add(r0);	 Catch:{ all -> 0x037b }
    L_0x02ea:
        r11 = r0.g;	 Catch:{ all -> 0x037b }
        r13 = r9.a;	 Catch:{ all -> 0x037b }
        r11 = r11 + r13;
        r0.g = r11;	 Catch:{ all -> 0x037b }
        goto L_0x02d1;
    L_0x02f2:
        r8 = r8.getKey();	 Catch:{ all -> 0x037b }
        r3.add(r8);	 Catch:{ all -> 0x037b }
        goto L_0x025a;
    L_0x02fb:
        r4 = r3.iterator();	 Catch:{ all -> 0x037b }
    L_0x02ff:
        r8 = r4.hasNext();	 Catch:{ all -> 0x037b }
        if (r8 == 0) goto L_0x0318;
    L_0x0305:
        r8 = r4.next();	 Catch:{ all -> 0x037b }
        r8 = (java.lang.String) r8;	 Catch:{ all -> 0x037b }
        r9 = r0.f;	 Catch:{ all -> 0x037b }
        if (r9 == 0) goto L_0x0312;
    L_0x030f:
        monitor-exit(r2);	 Catch:{ all -> 0x037b }
        goto L_0x0386;
    L_0x0312:
        r9 = r0.b;	 Catch:{ all -> 0x037b }
        r9.remove(r8);	 Catch:{ all -> 0x037b }
        goto L_0x02ff;
    L_0x0318:
        monitor-exit(r2);	 Catch:{ all -> 0x037b }
        r3.clear();
        r3 = r0.c;
        r4 = new c.h.a.w.k.g;
        r4.m2123init(r0);
        java.util.Collections.sort(r3, r4);
        r0.e = r7;
        r3 = r0.f;
        if (r3 == 0) goto L_0x032d;
    L_0x032c:
        goto L_0x0386;
    L_0x032d:
        monitor-enter(r2);
        r3 = r0.d;	 Catch:{ all -> 0x0378 }
        r3 = r3.iterator();	 Catch:{ all -> 0x0378 }
    L_0x0334:
        r4 = r3.hasNext();	 Catch:{ all -> 0x0378 }
        if (r4 == 0) goto L_0x0348;
    L_0x033a:
        r4 = r3.next();	 Catch:{ all -> 0x0378 }
        r4 = (c.h.a.w.k.e.f) r4;	 Catch:{ all -> 0x0378 }
        r7 = r0.b;	 Catch:{ all -> 0x0378 }
        r8 = r0.c;	 Catch:{ all -> 0x0378 }
        r4.a(r7, r8);	 Catch:{ all -> 0x0378 }
        goto L_0x0334;
    L_0x0348:
        monitor-exit(r2);	 Catch:{ all -> 0x0378 }
        r2 = r0.d;
        r2.clear();
        r2 = "AnalyzeRepeatFile";
        r3 = new java.lang.StringBuilder;
        r3.<init>();
        r4 = "checkRepeatFile: count = ";
        r3.append(r4);
        r0 = r0.b;
        r0 = r0.size();
        r3.append(r0);
        r0 = ", time = ";
        r3.append(r0);
        r7 = java.lang.System.currentTimeMillis();
        r7 = r7 - r5;
        r3.append(r7);
        r0 = r3.toString();
        android.util.Log.d(r2, r0);
        goto L_0x0386;
    L_0x0378:
        r0 = move-exception;
        monitor-exit(r2);	 Catch:{ all -> 0x0378 }
        throw r0;
    L_0x037b:
        r0 = move-exception;
        monitor-exit(r2);	 Catch:{ all -> 0x037b }
        throw r0;
    L_0x037e:
        r4 = r0.f;
        if (r4 == 0) goto L_0x0233;
    L_0x0382:
        goto L_0x0386;
    L_0x0383:
        r0 = move-exception;
        monitor-exit(r4);	 Catch:{ all -> 0x0383 }
        throw r0;
    L_0x0386:
        return;
        */
        throw new UnsupportedOperationException("Method not decompiled: c.h.a.w.l.a.run():void");
    }
}
